<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-form ref="form" :model="quo" :rules="rules" label-width="100px" id="mvcfm">
          <el-button @click="gotoPage('/psi/supplychainmana/AmendmentContract?'+vueparams+'')" type='success' size="mini"><i class='fa fa-edit'></i>修改</el-button>
          <el-button @click="gotoPage('/psi/supplychainmana/ProcurementContractS?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
          <div class="form-unit">
            <span class="mvc-title-left"> 合同详情 </span>
          </div>
          <div>
            <el-row>
              <el-col :span="12">
                <el-form-item label="合同编号" prop="quo_num">
                  {{quo.quo_num}}
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="合同主题" prop="">
                  {{quo.quo_theme}}
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="供应商" prop="">
                  {{quo.quo_client}}
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="联系人" prop="">
                  {{quo.quo_contact}}
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="供应商地址" prop="">
                  <div style="white-space: pre-wrap;">{{quo.quo_address}}</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="签订日期" prop="quo_pacttime">
                  {{getDateTimeString(quo,'quo_pacttime')}}
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="失效日期 " prop="">
                  {{getDateTimeString(quo,'quo_faildate')}}
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <div class="form-unit">
            <span class="mvc-title-left"> 列表条目 </span>
          </div>
          <el-table :data="pum">
            <el-table-column label="产品条形码" prop="product_barcode">
            </el-table-column>
            <el-table-column label="供应商" prop="client_name">
            </el-table-column>
            <el-table-column label="产品名称" prop="pronum_prodece">
            </el-table-column>
            <el-table-column label="产品型号" prop="product_model">
            </el-table-column>
            <el-table-column label="产品规格" prop="product_norm">
            </el-table-column>
            <el-table-column label="简要描述" prop="product_des">
            </el-table-column>
            <el-table-column label="补充" prop="pronum_remark">
            </el-table-column>
            <el-table-column label="数量" prop="pronum_no">
            </el-table-column>
            <el-table-column label="数量单位" prop="pronum_nuit">
            </el-table-column>
            <el-table-column label="单价" prop="pronum_price">
            </el-table-column>
            <el-table-column label="发货时间" prop="pronum_endate">
              <template slot-scope="scope">
                {{getDateTimeString(scope.row,'pronum_endate')}}
              </template>
            </el-table-column>
            <el-table-column label="总价" prop="total_prices">
            </el-table-column>
          </el-table>
          <div class="form-unit">
            <span class="mvc-title-left"> 甲乙双方责任 </span>
          </div>
          <el-table :data="s_duty">
            <el-table-column label="备注" prop="description">
            </el-table-column>
          </el-table>
          <div class="form-unit">
            <span class="mvc-title-left"> 付款方式 </span>
          </div>
          <el-table :data="s_pay">
            <el-table-column label="首次付款" prop="pay_first">
            </el-table-column>
            <el-table-column label="二次付款" prop="pay_sec">
            </el-table-column>
            <el-table-column label="尾付款" prop="pay_end">
            </el-table-column>
          </el-table>
          <div class="form-unit">
            <span class="mvc-title-left"> 付款账号 </span>
          </div>
          <el-table :data="s_bank">
            <el-table-column label="类型" prop="bank_type">
            </el-table-column>
            <el-table-column label="银行名称" prop="bank_tname">
            </el-table-column>
            <el-table-column label="开户姓名" prop="bank_tname">
            </el-table-column>
            <el-table-column label="银行账号" prop="bank_account">
            </el-table-column>
          </el-table>
          <div class="form-unit">
            <span class="mvc-title-left"> 违约责任 </span>
          </div>
          <el-table :data="s_breakduty">
            <el-table-column label="备注" prop="description">
            </el-table-column>
          </el-table>
          <div class="form-unit">
            <span class="mvc-title-left"> 其他要求 </span>
          </div>
          <el-table :data="s_demand">
            <el-table-column label="备注" prop="description">
            </el-table-column>
          </el-table>
          <div>
          </div>
          <div>
            <el-row>
              <el-col :span="24">
                <el-form-item label="内部备注" prop="">
                  <div style="white-space: pre-wrap;">{{quo.quo_insides}}</div>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'采购合同'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'ContractDetails',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        quo: {
          quo_num: null,
          quo_theme: null,
          quo_client: null,
          quo_contact: null,
          quo_address: null,
          quo_pacttime: null,
          quo_faildate: null,
        },
        pum: [],
        s_duty: [],
        s_pay: [],
        s_bank: [],
        s_breakduty: [],
        s_demand: [],
        loading: false,
        Container: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "821959E4C08E497BA9C4B10D9571712F",
        name: "采购任务右菜单",
        selected: "采购合同"
      }, 'Container', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/ProcureSupplyAction/contractDetails?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
    },
  }
</script>
